<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<title>终端管理</title>
		<link id="easyuiTheme" rel="stylesheet" type="text/css"
			href="<s:url value='../jquery-easyui/themes/stategrid/easyui.css'/>">
		<link rel="stylesheet" type="text/css"
			href="<s:url value='../jquery-easyui/themes/icon.css'/>">

		<script type='text/javascript'
			src="<s:url value='../ajax-pushlet-client.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../jquery-easyui/jquery-1.7.2.min.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../jquery-easyui/locale/easyui-lang-zh_CN.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../js/common/highcharts.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../js/common/highChartsTheme.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../js/common/jquery.blockUI.js'/>"></script>
		<script type="text/javascript">
		
		// 显示遮盖层
		function block(){
		    $.blockUI({
		        message: '页面加载中，请稍后...',
		        css: {
		            /*border: 'none',  */
		            padding: '10px',
		            backgroundColor: '#000',
		            '-webkit-border-radius': '10px',
		            '-moz-border-radius': '10px',
		            opacity: '.5',
		            color: '#fff'
		        },
		        overlayCSS: {
		            opacity: .3
		        }
		    });
		}
		
		// 隐藏遮盖层
		function unBlock(){
		    $.unblockUI();
		}
		
		// 点击查看按钮查看曲线图
		function showLineChart() {
			/**$("#listDiv").fadeOut("slow");
			$("#terminalInfoDiv").fadeIn("fast");
			$("#showBtn").val("显示终端列表");
			
			// 装载内容
			$("#terminalAddr").val(terminalAddr);
			$("#bureauName").val(bureauName);
			$("#stationName").val(stationName);
			$("#location").val(location);**/
			
			var terminalAddr = $("#terminalAddr").val()
			// 曲线类型
			var flag = $("#flag").val();
			switch(flag) {
				case "showActivePowerCurve":
				$("#lineChart").attr("src", "../zoneAreaMonitor/showActivePowerCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showReactivePowerCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showReactivePowerCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showPowerFactorCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showPowerFactorCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showVoltageCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showVoltageCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showCurrentCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showCurrentCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showZeroSequenceCurrentCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showZeroSequenceCurrentCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showActivePowerEnergyCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showActivePowerEnergyCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showReactivePowerEnergyCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showReactivePowerEnergyCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showActivePowerIndicationCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showActivePowerIndicationCurve.action?terminalAddr=" + terminalAddr);
				break;
				case "showReactivePowerIndicationCurve":
				$("#lineChart").attr("src", "zoneAreaMonitor!showReactivePowerIndicationCurve.action?terminalAddr=" + terminalAddr);
				break;
			}	
		}
		
		// 显示或者隐藏终端列表
		function showOrHideTerminalList() {
			
			if ("显示终端列表" == $("#showBtn").val()) {
				$("#showBtn").val("隐藏终端列表");
				$("#listDiv").fadeIn("slow");
			} else {
				$("#showBtn").val("显示终端列表");
				$("#listDiv").fadeOut("slow");
			}
		}
		
		function setWinHeight(obj)
		{
			var win=obj;
			if (document.getElementByIdx) {
				if (win && !window.opera) {
					if (win.contentDocument && win.contentDocument.body.offsetHeight)
						win.height = win.contentDocument.body.offsetHeight;
					else if(win.Document && win.Document.body.scrollHeight)
						win.height = win.Document.body.scrollHeight;
				}
			}
		}
		</script>
		<style type="text/css">
.inputText {
	align: left;
	width: 180px;
}

#showBtn {
	width: 90px;
	height: 24px;
	padding: 4px;
	margin: 4px;
	background-color: #5793CD;
	float: left;
	clear: left;
	color: #ffffff;
	border-style: none;
	border: 1px solid #3575B3;
	border-bottom: 1px solid #1F4468;
	border-top: 1px solid #AFCBE7;
}

#listDiv {
	margin-left: 8px;
	margin-top: 5px;
}
</style>
	</head>
	<body>
		<div id="listDiv">
			<input type="text" value="07310101" id="terminalAddr"
				name="terminalAddr" />
			<input type="button" value="查看" onclick="showLineChart();" />
			<s:hidden id="flag" name="flag"></s:hidden>
		</div>
		<iframe id="lineChart" name="lineChart" frameborder="0"
			scrolling="auto" width="100%" height="500"
			onload="Javascrīpt:setWinHeight(this)">
		</iframe>
	</body>
</html>
